<template>
  <div>
      <el-table :data="tableData" style="width: 100%" height="500" border>
            <el-table-column
                prop="id"
                label="菜品编号"
                width="180" header-align="center">
            </el-table-column>
            <el-table-column
                prop="name"
                label="菜品名称"
                width="180" header-align="center">
            </el-table-column>
            <el-table-column
                prop="num" width="180"
                label="菜品数量" header-align="center">
            </el-table-column>
        </el-table>
  </div>
</template>

<script>
import axios from 'axios'

export default {
    data(){
        return {
            tableData:[{id:1,name:'123',num:'2'}]
        }
    },
    methods:{
        initData(){
            const self = this
            axios.get("http://127.0.0.1:3008/api/foodsfe")
            .then(res=>{
                console.log(res.data);
                self.datas = res.data[0].id
                self.todos = res.data
                console.log(res.data);
                console.log(this.tableData);
                this.tableData = res.data
            })
        },
    },
    mounted(){          
        this.initData();
    }
}
</script>

<style>

</style>